//
//  VideoRelatedTableViewCell.m
//  Arts1
//
//  Created by Liujl on 15/9/18.
//  Copyright (c) 2015年 Arts1. All rights reserved.
//

#import "VideoRelatedTableViewCell.h"
#import <UIImageView+WebCache.h>
#import "AllHeader.h"


@implementation VideoRelatedTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        UIView *whiteView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, SCREEN_WIDTH - 20, self.bounds.size.height)];
        whiteView.backgroundColor = [UIColor whiteColor];
        
        _mainImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH - 20, 9 * (SCREEN_WIDTH - 20) / 16)];
        [_mainImageView setContentMode:(UIViewContentModeScaleAspectFill)];
        _mainImageView.backgroundColor = kRandomColor;
        _mainImageView.layer.masksToBounds = YES;
        [whiteView addSubview:_mainImageView];
        
        [self addSubview:whiteView];
        
    }
    return self;
}

- (void)setImageURL:(NSString *)imageURL{
    _imageURL = [NSString stringWithFormat:@"%@%@",_photourl,imageURL];
     [_mainImageView sd_setImageWithURL:[NSURL URLWithString:_imageURL] placeholderImage:nil options:(SDWebImageRetryFailed | SDWebImageLowPriority)];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
